package com.ib.algokit;

import org.activequant.core.domainmodel.data.Candle;
import org.activequant.core.domainmodel.data.Quote;
import org.activequant.core.domainmodel.data.TickerNews;
import org.activequant.core.domainmodel.data.TradeIndication;
import org.activequant.util.charting.TimeseriesCombinedChart;

public interface AnalyzerPluginInterface {
	
	void onCandle(Candle liveCandle);
	
	void onTradeIndication(TradeIndication liveTradeIndication);
	
	void onQuote(Quote liveQuote);
	
	void onTickerNews(TickerNews liveTickerNews);
	/**
	 * returns a TimeseriesCombinedChart which typically will hold a plot with the candle price, trade indication quantity and price, quote bid/ask size and price
	 * and recommendation plot
	 * @return
	 */
	TimeseriesCombinedChart getTimeseriesCombinedChart();
	
//	void calculateSAR(CandleSeries refSeries);
	
//	void calculateWMA(CandleSeries refSeries, int period);
	
//	void calculateEMA(CandleSeries refSeries, int period);
	
//	void calculateMEMA(CandleSeries refSeries, int period);
	/**
	 * Finds the High/Low Candles from the historical T_MINUS_5D Candles and then sets the associated ONEM_T_MINUS_5_HIGH(Candle) and ONEM_T_MINUS_5_LOW(Candle)
	 * with those 2 Candles
	 */
//	void getTMINUS5DHighAndLowCandles();
//	/**
//	 * Finds the High/Low Candles from the historical T_MINUS_1Y Candles and then sets the associated ONED_T_MINUS_1Y_HIGH(Candle) and ONED_T_MINUS_1Y_LOW(Candle)
//	 * with those 2 Candles
//	 */
//	void getTMINUS1YHighAndLowCandles();
	/**
	 * If not set yet, loops through intra day prices of last 5 business days and for days with more than 50 intra-day prices, it calculates DayFeatures with optimalTargetProfit and timeToWaitOnExecution.<br/>
	 * Then it calculates a weighted average (last day -> biggest impact) and sets the associated weightedNanoSecondsToWaitOnExecution(long) and weightedOptimalProfit(double)
	 */
//	void initializeTMINUS5DWeightedDayFeatures();
	/**
	 * called on each live Candle to keep updating low/high 200/5/mostRecent values
	 * @param liveCandle
	 */
	void updateExtremes(Candle liveCandle);
	
	long getNanoSecondsToWaitOnExecution();
	
	double getTargetProfit();
}
